#include "HeartTask.h"
#include "OSAL_Timers.h"
volatile int heart_start = 0;
volatile int GheartTaskId = 0;
//this file is used to create a heart task for heart command
void HeartTask_Init( uint8 task_id )
{
	heart_start = 0;
        GheartTaskId = task_id;
	osal_start_timerEx( task_id,
	                       HEARTTASK_SEND_MSG_EVT,
	                       HEARTTASK_SEND_MSG_TIMEOUT );
}

uint16 HeartTask_ProcessEvent( uint8 task_id, uint16 events )
{
	if ( events & HEARTTASK_SEND_MSG_EVT )
	{
		//set heart start flag = 1 ,then can send heart command.
		heart_start = 1;
                //osal_start_timerEx( task_id,
	                       // HEARTTASK_SEND_MSG_EVT,
	                       // HEARTTASK_SEND_MSG_TIMEOUT );
	    return (events ^ HEARTTASK_SEND_MSG_EVT);                   
	}
	return 0;
}
